###########################################################################################
# Build dataset required for training and test
# build_dataset.py is to convert dicom files to hdf5 files.
# flip_dataset.py is to train a network to predict whether CT is scanned from head to feet.
# You could sequentially execute the following commands by runing this bash script.
# Or simultaneously run commands in the recommended order to successfully run the code.
###########################################################################################

# training dataset
## two versions of lidc, different in the way to order the slices
python build_dataset.py -i '/data-disk/LIDC_new/DOI' -o '../../data/lidc_v9' -m 'lidc' -v v9
python build_dataset.py -i '/data-disk/LIDC_new/DOI' -o '../../data/lidc_v15' -m 'lidc' -v v15
## kaggle stage1
python build_dataset.py -i '/dataset/Kaggle/kaggle_data/stage1' -o '../../data/kaggle' -m 'kaggle'
## spie
python build_dataset.py -i '/dataset/dingj/openSourceDataset/SPIE/DCM' -o '../../data/spie' -m 'spie'

# flip
## flip kaggle stage1 according to our manual label
python flip_dataset.py -d '../../data/kaggle/vol.hdf5' -l './flip_list.npy'
## train network to flip CT according to kaggle stage1 data after being adjusted
## predict kaggle stage2 after training the 'flip regression' network
## codes and scripts are in another fold named as 'flip_regression'
## you could manually enter that fold to run the following bash
cd '../flip_regression'
bash flip_train.sh
